/*
 * MyCanvas.java
 *
 * Created on 3 de noviembre de 2007, 01:30 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package interfaces;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;

/**
 *
 * @author Fanny Paola Vadillo Herrera
 * @author Luis Manuel Pineda Llano
 */

public class MyCanvas extends Canvas {

	int datos[] = {5, 40, 75, 110, 145, 180, 215, 250, 285, 320, 355, 390, 425};
        int alturas[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

	public MyCanvas() {
            setBackground (Color.white);
            setSize(435, 460);
  	}
  	
  	/* 
  	 * Se asignan las alturas
  	 */
  	public void setAlturas(int []alts) {
            for(int i = 0; i < alts.length; i++) {
                alturas[i] = alts[i];
            }
  	}
  	
	/*
	 * Se pinta en el Canvas
	 */
  	public void paint(Graphics g) {
            g.setColor(new Color(255, 128, 128));
            g.fillRect(0, datos[0], alturas[0], 30);
            
            g.setColor(new Color(255, 255, 128));
            g.fillRect(0, datos[1], alturas[1], 30);
            
            g.setColor(new Color(128, 255, 128));
            g.fillRect(0, datos[2], alturas[2], 30);
            
            g.setColor(new Color(202, 202, 255));
            g.fillRect(0, datos[3], alturas[3], 30);
            
            g.setColor(new Color(255, 204, 230));
            g.fillRect(0, datos[4], alturas[4], 30);
            
            g.setColor(new Color(152, 203, 203));
            g.fillRect(0, datos[5], alturas[5], 30);
            
            g.setColor(new Color(255, 184, 113));
            g.fillRect(0, datos[6], alturas[6], 30);
            
            g.setColor(new Color(209, 164, 255));
            g.fillRect(0, datos[7], alturas[7], 30);
            
            g.setColor(new Color(255, 0, 0));
            g.fillRect(0, datos[8], alturas[8], 30);
            
            g.setColor(new Color(0, 255, 0));
            g.fillRect(0, datos[9], alturas[9], 30);
            
            g.setColor(new Color(0, 0, 255));
            g.fillRect(0, datos[10], alturas[10], 30);
            
            g.setColor(new Color(128, 0, 255));
            g.fillRect(0, datos[11], alturas[11], 30);
            
            g.setColor(new Color(128, 255, 0));
            g.fillRect(0, datos[12], alturas[12], 30);
 	}
}